import React ,{ Component } from 'react';

import { withRouter,NavLink} from 'react-router-dom';
import {observer,inject} from 'mobx-react';
// 导入需要的模块
@withRouter
@inject('obs','newobs')
@observer
class View extends Component {

    newobs = this.props.newobs;
    hdPerson(){
        const { changePerson } = this.newobs;
        changePerson('test');
    }
    render(){
        // this.props.newobs
        const { name,personCfg } = this.newobs;

        return(
            <div className="m">
                {/*<NavLink to="/">首页</NavLink><br/>
                <NavLink to="/input">表单</NavLink><br/>
                <NavLink to="/event">事件</NavLink><br/>
                <NavLink to="/storedemo">storedemo</NavLink><br/>
                <NavLink to="/observable">observable</NavLink><br/>*/}
                <NavLink to="/teststore">下午的页面：teststore</NavLink><br/>
                <NavLink to="/newobs">上午的页面：newobs</NavLink>
                <h3>课程内容：observable</h3>
                <dl>
                    <dt>{name}</dt>
                    <dd>{personCfg.name}</dd>
                    <dd>{personCfg.age}</dd>
                    <dd>{personCfg.sex}</dd>
                    <dd><input onClick={(e)=>this.hdPerson(e)} type="button" value="更改"/></dd>
                </dl>
            </div>
        )
    }
}
export default View;
